package com.trkj.pojos;

import java.io.Serializable;
import javax.persistence.*;
import java.util.List;


/**
 * The persistent class for the BUILD database table.
 * 
 */
@Entity
@NamedQuery(name="Build.findAll", query="SELECT b FROM Build b")
public class Build implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name="BUILD_ID")
	private String buildId;

	private String buildname;

	//bi-directional many-to-one association to Floor
	@OneToMany(mappedBy="build")
	private List<Floor> floors;

	public Build() {
	}

	public String getBuildId() {
		return this.buildId;
	}

	public void setBuildId(String buildId) {
		this.buildId = buildId;
	}

	public String getBuildname() {
		return this.buildname;
	}

	public void setBuildname(String buildname) {
		this.buildname = buildname;
	}

	public List<Floor> getFloors() {
		return this.floors;
	}

	public void setFloors(List<Floor> floors) {
		this.floors = floors;
	}

	public Floor addFloor(Floor floor) {
		getFloors().add(floor);
		floor.setBuild(this);

		return floor;
	}

	public Floor removeFloor(Floor floor) {
		getFloors().remove(floor);
		floor.setBuild(null);

		return floor;
	}

}